/*
Copyright 2022 The Numaproj Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by Openapi Generator. DO NOT EDIT.

/// Backoff : Backoff defines parameters used to systematically configure the retry strategy.

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Backoff {
    #[serde(rename = "cap", skip_serializing_if = "Option::is_none")]
    pub cap: Option<kube::core::Duration>,
    /// Interval is multiplied by factor each iteration, if factor is not zero and the limits imposed by Steps and Cap have not been reached.
    #[serde(rename = "factor", skip_serializing_if = "Option::is_none")]
    pub factor: Option<f64>,
    #[serde(rename = "interval", skip_serializing_if = "Option::is_none")]
    pub interval: Option<kube::core::Duration>,
    /// The sleep at each iteration is the interval plus an additional amount chosen uniformly at random from the interval between zero and `jitter*interval`.
    #[serde(rename = "jitter", skip_serializing_if = "Option::is_none")]
    pub jitter: Option<f64>,
    /// Steps defines the maximum number of retry attempts
    #[serde(rename = "steps", skip_serializing_if = "Option::is_none")]
    pub steps: Option<i64>,
}

impl Backoff {
    /// Backoff defines parameters used to systematically configure the retry strategy.
    pub fn new() -> Backoff {
        Backoff {
            cap: None,
            factor: None,
            interval: None,
            jitter: None,
            steps: None,
        }
    }
}
